package com.innodata.riskEngine.common.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

public class RulePO implements Serializable {
    private static final long serialVersionUID = -6627537664339598686L;
    /**
     * 主键
     */
    private Long id;
    /**
     * 渠道
     */
    private String channel;
    /**
     * 规则场景
     */
    private String scenario;
    /**
     * 窗口大小
     */
    private Long windowSize;
    /**
     * 窗口大小单位
     */
    private String windowSizeUnit;
    /**
     * 窗口步长（目前固定为1s）
     */
    private Long windowSlide;
    /**
     * 窗口步长单位
     */
    private String windowSlideUnit;
    /**
     * 阈值
     */
    private Long threshold;
    /**
     * 预警间隔
     */
    private Long warningInterval;
    /**
     * 预警间隔单位
     */
    private String warningIntervalUnit;
    /**
     * 预警信息
     */
    private String warningMessage;
    /**
     * 规则描述
     */
    private String mark;
    /**
     * 状态: 1-新建；2-启用待审核；3-启用审核被拒；4-已启用；5-停用待审核；6-停用
     */
    private String state;

    /**
     * 创建用户
     */
    private String createUser;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新用户
     */
    private String updateUser;
    /**
     * 更新时间
     */
    private Date updateTime;

    // setter and getter

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getScenario() {
        return scenario;
    }

    public void setScenario(String scenario) {
        this.scenario = scenario;
    }

    public Long getWindowSize() {
        return windowSize;
    }

    public void setWindowSize(Long windowSize) {
        this.windowSize = windowSize;
    }

    public String getWindowSizeUnit() {
        return windowSizeUnit;
    }

    public void setWindowSizeUnit(String windowSizeUnit) {
        this.windowSizeUnit = windowSizeUnit;
    }

    public Long getWindowSlide() {
        return windowSlide;
    }

    public void setWindowSlide(Long windowSlide) {
        this.windowSlide = windowSlide;
    }

    public String getWindowSlideUnit() {
        return windowSlideUnit;
    }

    public void setWindowSlideUnit(String windowSlideUnit) {
        this.windowSlideUnit = windowSlideUnit;
    }

    public Long getThreshold() {
        return threshold;
    }

    public void setThreshold(Long threshold) {
        this.threshold = threshold;
    }

    public Long getWarningInterval() {
        return warningInterval;
    }

    public void setWarningInterval(Long warningInterval) {
        this.warningInterval = warningInterval;
    }

    public String getWarningIntervalUnit() {
        return warningIntervalUnit;
    }

    public void setWarningIntervalUnit(String warningIntervalUnit) {
        this.warningIntervalUnit = warningIntervalUnit;
    }

    public String getWarningMessage() {
        return warningMessage;
    }

    public void setWarningMessage(String warningMessage) {
        this.warningMessage = warningMessage;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RulePO rulePO = (RulePO) o;
        return Objects.equals(id, rulePO.id) && Objects.equals(channel, rulePO.channel) && Objects.equals(scenario, rulePO.scenario) && Objects.equals(windowSize, rulePO.windowSize) && Objects.equals(windowSizeUnit, rulePO.windowSizeUnit) && Objects.equals(windowSlide, rulePO.windowSlide) && Objects.equals(windowSlideUnit, rulePO.windowSlideUnit) && Objects.equals(threshold, rulePO.threshold) && Objects.equals(warningInterval, rulePO.warningInterval) && Objects.equals(warningIntervalUnit, rulePO.warningIntervalUnit) && Objects.equals(warningMessage, rulePO.warningMessage) && Objects.equals(mark, rulePO.mark) && Objects.equals(state, rulePO.state) && Objects.equals(createUser, rulePO.createUser) && Objects.equals(createTime, rulePO.createTime) && Objects.equals(updateUser, rulePO.updateUser) && Objects.equals(updateTime, rulePO.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, channel, scenario, windowSize, windowSizeUnit, windowSlide, windowSlideUnit, threshold, warningInterval, warningIntervalUnit, warningMessage, mark, state, createUser, createTime, updateUser, updateTime);
    }

    @Override
    public String toString() {
        return "RulePO{" +
                "id=" + id +
                ", channel='" + channel + '\'' +
                ", scenario='" + scenario + '\'' +
                ", windowSize=" + windowSize +
                ", windowSizeUnit='" + windowSizeUnit + '\'' +
                ", windowSlide=" + windowSlide +
                ", windowSlideUnit='" + windowSlideUnit + '\'' +
                ", threshold=" + threshold +
                ", warningInterval=" + warningInterval +
                ", warningIntervalUnit='" + warningIntervalUnit + '\'' +
                ", warningMessage='" + warningMessage + '\'' +
                ", mark='" + mark + '\'' +
                ", state='" + state + '\'' +
                ", createUser='" + createUser + '\'' +
                ", createTime=" + createTime +
                ", updateUser='" + updateUser + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }
}
